package io.kiki.sba.registry.common.model;


import org.apache.commons.lang.StringUtils;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;


public class CollectionSdks {

    public static List<String> toIpList(String ips) {
        String[] ipArray = StringUtils.split(ips.trim(), ';');
        List<String> ret = new ArrayList<>(ipArray.length);
        for (String ip : ipArray) {
            ret.add(ip.trim());
        }
        return ret;
    }

    public static Set<String> toIpSet(String ips) {
        return new HashSet<>(toIpList(ips));
    }
}
